﻿#ifndef CLIENTWINDOW_H
#define CLIENTWINDOW_H

#include "client_class_def.h"

#include <QWidget>

namespace Ui { class ClientWindow; }

class ClientWindow : public QWidget{
    Q_OBJECT
public:
    explicit ClientWindow(QWidget *parent=nullptr);

private:
    Ui::ClientWindow *ui;
    ClientThread *client_thread_;
    std::string pubkey_, prikey_;

    void InitWindow();
    void InitUiConn();
    void InitSubThread();
    void InitCustomSignalConn();

private slots:
    void OnPushButtonSendClicked(void);
    void OnPushButtonConnectClicked(void);
    void OnReceiveMessage(const char* msg);
    void OnPushButtonShowPubkeyClicked(void);
    void OnPushButtonShowPrikeyClicked(void);


public slots:
    void OnShowSysMessage(const char* msg);
    void OnPrevSendComplete(void);

signals:
    void SignalReceiveMessage(const char* msg);
    void SignalShowSysMessage(const char* msg);
    void SignalPrevSendComplete(void);
};

#endif
